Skip to content

[BUGFIX] Fix UserRepository instantiation in UserUtility::getCurrentUser()#677

Open
smirgol wants to merge 1 commit intoin2code-de:mainfrom
smirgol:bugfix/userrepository-di-typo3-13
Open

[BUGFIX] Fix UserRepository instantiation in UserUtility::getCurrentUser()#677
smirgol wants to merge 1 commit intoin2code-de:mainfrom
smirgol:bugfix/userrepository-di-typo3-13

Conversation

@smirgol
Copy link

@smirgol smirgol commented Oct 27, 2025

When using makeInstance() to get the UserRepository in getCurrentUser(), the inject methods (like injectPersistenceManager) might not get called under certain circumstances in TYPO3 v13.

This can cause "Typed property Repository::$persistenceManager must not be accessed before initialization" errors when the repository is used.

Changed to use container->get() instead of makeInstance() which ensures proper dependency injection.

Tested with TYPO3 v13.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant